﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BatchTree.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Audit.BatchTree" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script type="text/javascript" src="../../Scripts/jquery-1.6.min.js"></script>
    <script language="javascript" type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
    <link href="../../Styles/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/icon.css" rel="stylesheet" type="text/css" />   
    <link href="../../Styles/control.css" rel="stylesheet" type="text/css" /> 
    <script type="text/javascript">

        $(function () {
            var isFirst = true;
            $('#treeProject').tree({
                checkbox: false,
                dnd: false,
                url: 'AuditHandler.ashx?randID=' + escape(new Date()),
                method: "POST",
                onClick: function (node) {
                    var uri = node.attributes["URL"];
                    uri += uri.indexOf('?') > 0 ? '&' : '?';
                    uri += 'FunctionID=<%=Request["FunctionID"] %>';
                    uri += '&<%=Honestysoft.Financing.WebUI.Module.Audit.AuditUtils.ParamName_AuditNodeType %>=' + node.attributes["<%=Honestysoft.Financing.WebUI.Module.Audit.AuditUtils.ParamName_AuditNodeType %>"];
                    uri += '&NodeText=' + escape(node.text);
                    window.parent.frames["ifrmInfo"].location.href = uri;
                    $('#treeProject').tree('expand', node.target);
                },
                onBeforeExpand: function (node, param) {
                    $('#treeProject').tree('options').url = 'AuditHandler.ashx?<%=Honestysoft.Financing.WebUI.Module.Audit.AuditUtils.ParamName_AuditNodeType %>=' + node.attributes["<%=Honestysoft.Financing.WebUI.Module.Audit.AuditUtils.ParamName_AuditNodeType %>"] + '&BatchID=' + node.attributes["BatchID"] + '&ProjectID=' + node.attributes["ProjectID"] + '&ContractID=' + node.attributes["ContractID"] + '&randID=' + escape(new Date())
                },
                onLoadSuccess: function (node, data) {
                    if (data != "") {
                        var rootNode = $('#treeProject').tree('getRoot');
                        $('#treeProject').tree('expand', rootNode.target);
                        if (isFirst) {
                            $('#treeProject').tree('select', rootNode.target);
                            isFirst = false;
                        }
                    }
                }
            });
        });
	</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>    
    <ul id="treeProject"></ul>
    </div>
    </form>
</body>
</html>